package com.ethank.enums.ali;

import com.ethank.entity.VoucherResponseVO;

import java.util.ArrayList;
import java.util.List;

/**
 * @author tf
 * @date 2024-03-25
 * @Description
 */
public enum InvoiceAndTaxiEnum {
    TYPE("type", "类型", "", 1, false),
    INVOICE_CODE("invoiceCode", "发票代码", "", 1, true),
    INVOICE_NUMBER("invoiceNumber", "发票号码", "", 1, true),
    LICENSE_PLATE_NUMBER("licensePlateNumber", "车牌号", "", 1, false),
    DATE("date", "乘车日期", "", 2, true),
    PICK_UP_TIME("pickUpTime", "上车时间", "", 3, false),
    DROP_OFF_TIME("dropOffTime", "下车时间", "", 3, false),
    MILEAGE("mileage", "里程", "", 1, false),
    FARE("fare", "金额", "", 1, true),
    BILL_TYPE("billType", "发票类型", "", 1, false);

    private final String key;
    private final String label;
    private final String value;
    private final Integer type;
    private final boolean require;

    InvoiceAndTaxiEnum(String key, String label, String value, Integer type, boolean require) {
        this.key = key;
        this.label = label;
        this.value = value;
        this.type = type;
        this.require = require;
    }

    public String getKey() {
        return key;
    }

    public String getLabel() {
        return label;
    }

    public String getValue() {
        return value;
    }

    public Integer getType() {
        return type;
    }

    public boolean isRequire() {
        return require;
    }

    public static List<VoucherResponseVO> convertVoucher() {
        ArrayList<VoucherResponseVO> vos = new ArrayList<>();
        for (InvoiceAndTaxiEnum fieldEnum : InvoiceAndTaxiEnum.values()) {
            VoucherResponseVO vo = new VoucherResponseVO();
            vo.setKey(fieldEnum.getKey());
            vo.setLabel(fieldEnum.getLabel());
            vo.setType(fieldEnum.getType());
            vos.add(vo);
        }
        return vos;
    }
}
